package com.cmc.cloud.cmclink.doc.convert;

import java.util.List;

import com.cmc.cloud.cmclink.doc.vo.blnolocalcostvo.*;import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

import com.cmc.cloud.cmclink.doc.entity.BlnoDO;
import com.cmc.cloud.cmclink.doc.entity.BlnoLocalChargeDO;
import com.cmc.cloud.cmclink.doc.entity.BlnoLocalCostDO;
import com.cmc.cloud.cmclink.doc.entity.BlnoLocalCostDetailDO;
import com.cmc.cloud.cmclink.fin.api.base.dto.req.DocBlnoFreightInfoReqDTO;

/**
 * 提单本地费用 Convert
 *
 * @author 招商轮船-管理员
 */
@Mapper
public interface BlnoLocalCostImConvert {
    /**
     * 获取转换接口的实例
     */
    BlnoLocalCostImConvert INSTANCE = Mappers.getMapper(BlnoLocalCostImConvert.class);

    /**
     * convert
     *
     * @param localCostDO localCostDO
     * @return BlnoLocalCostDO
     */
    BlnoLocalCostDO convertLocalCostDO(BlnoLocalCostDO localCostDO);

    /**
     * convert
     *
     * @param localCostDO localCostDO
     * @return BlnoLocalCostDetailDO
     */
    BlnoLocalCostDetailDO convertLocalCostDetailDO(BlnoLocalCostDetailDO localCostDO);

    /**
     * convert
     *
     * @param list list
     * @return BlnoLocalCostImRespVO
     */
    List<BlnoLocalCostImRespVO> convertLocalCostImList(List<BlnoDO> list);
    /**
     * 将DO列表转换为查询响应VO列表
     *
     * @param list DO列表
     * @return VO List
     */
    List<BlnoLocalCostImMainRespVO> convertList(List<BlnoLocalCostDO> list);

    /**
     * 将DO列表转换为查询响应VO列表
     *
     * @param list DO列表
     * @return VO List
     */
    List<BlnoLocalCostImDetailRespVO> convertDetailList(List<BlnoLocalCostDetailDO> list);

    /**
     * 属性转换
     *
     * @param freight freight
     * @return list
     */
    @Mappings(value = {@Mapping(target = "freightId", source = "id"),
        @Mapping(target = "chargeCode", source = "chargeCode"), @Mapping(target = "chargeCategory", constant = "LOCAL"),
        @Mapping(target = "currency", source = "currency"), @Mapping(target = "amount", source = "amount"),
        @Mapping(target = "payment", source = "payment"),
        @Mapping(target = "redFreightId", source = "originalId"), @Mapping(target = "creator", source = "creator"),
        @Mapping(target = "createTime", source = "createTime", dateFormat = "yyyy-MM-dd HH:mm:ss")})
    DocBlnoFreightInfoReqDTO convertLocalCostReq(BlnoLocalCostDO freight);

    /**
     * convert
     *
     * @param reqVO reqVO
     * @return BlnoLocalCostDO
     */
    BlnoLocalCostDO convert(BlnoLocalCostImCreateReqVO reqVO);

    /**
     * convert
     *
     * @param reqVO reqVO
     * @return BlnoLocalCostDO
     */
    BlnoLocalCostDO convert(BlnoLocalCostImUpdateReqVO reqVO);

    /**
     * convert
     *
     * @param reqVO reqVO
     * @return BlnoLocalCostDO
     */
    BlnoLocalCostDO convert(BlnoLocalChargeDO reqVO);

    /**
     * convert
     *
     * @param localCostDetailDO localCostDetailDO
     * @return BlnoLocalCostDetailDO
     */
    BlnoLocalCostDO convertLocalCostDO(BlnoLocalCostDetailDO localCostDetailDO);
}
